package com.citcc.business.service;

import com.citcc.business.bean.CdzPush;
import com.citcc.business.mapper.CdzPushMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
public class CdzPushService {

    @Autowired
    private CdzPushMapper cdzPushMapper;

    @Transactional
    public int save(CdzPush cdzPush){
        return cdzPushMapper.insertSelective(cdzPush);
    }

    /**
     * 获取推送列表
     * @return
     */
    public List<CdzPush> getList(String userId){
        return cdzPushMapper.selectList(userId);
    }

    /**
     * 删除推送
     * @param id
     * @return
     */
    public int delete(String id){
        return cdzPushMapper.deleteByPrimaryKey(id);
    }

}